<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>fillStyle 填充绘色</title>
    <link rel="stylesheet" type="text/css" href="/css/YTSConfig.css">
    <link rel="stylesheet" type="text/css" href="/css/Style.css">
</head>
<body>
    <div class="body SuspensionFixationALLWindow">
        <canvas id="tutorial" class="canvas AbsHorizontalVerticalCenter"
            style="width: 300px; height: 150px;">
            <p>不支持类型内容, 这是一个 HTML Canvas 控件</p>
        </canvas>
    </div>

    <script type="text/javascript">
        var canvas = document.getElementById('tutorial');
        if (!canvas.getContext) {
            alert('不支持 canvas.getContext 意味: 不支持 canvas 属性');
        }
        var ctx = canvas.getContext('2d');

        for (var i = 0; i < 6; i++) {
            for (var j = 0; j < 6; j++) {
                var r = Math.floor(255 - 42.5*i);
                var g = Math.floor(255 - 42.5*j);
                var b = 0;
                ctx.fillStyle = 'rgb('+r+','+g+','+b+')';
                ctx.fillRect(j*25, i*25, 25, 25);
            }
        }
    </script>
</body>
</html>
